# coding: utf-8

import multiprocessing
import time
import threading
import os


def info(title):
    print('||||||||||||||||||||||||||||||')
    print(title)
    print('module name:',__name__)
    print('parent process:', os.getppid())
    print('process id:', os.getpid())
    print('||||||||||||||||||||||||||||||')


def f(name):
    info('\033[31;1mfunction f\033[0m')
    print('hello', name)


def thread_run():
    print('-------------------')
    print(threading.get_ident())
    print('===================')


def run(name):
    time.sleep(2)
    print("hello", name)
    t = threading.Thread(target=thread_run)
    t.start()


if __name__ == '__main__':
    # for i in range(10):
    #     p = multiprocessing.Process(target=run, args=('num %s' %i,))
    #     p.start()
        #p.join()
    info('\033[32;1mmain process line\033[0m')
    p = multiprocessing.Process(target=f, args=('1024',))